/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package makao;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * @author gekon
 */
public class CardsBackgroundPanel extends JPanel
{
    private Graphics2D graph2D;
    private ImageIcon tableIcon;
    private Image tableImage;

    @Override
    public void paintComponent(Graphics g)
    {
        graph2D = (Graphics2D) g;
        super.paintComponent(graph2D);
        
        setBackground();
        graph2D.drawImage(tableImage , 0, 0, this.getWidth(), this.getHeight(), this);
    }
    
    public void setBackground()
    {
        tableIcon = new ImageIcon("src/images/userCardsBackground.jpg");
        tableImage = tableIcon.getImage();
        this.repaint();
    }
}
